/*
 * Copyright 2012 Alain Pannetrat (L1L1@gmx.com)
 * 
 * This file is part of cookie-miner.
 * 
 * cookie-miner is free software: you can redistribute it and/or modify 
 * it under the terms of the GNU General Public License as published by 
 * the Free Software Foundation, either version 3 of the License, or 
 * (at your option) any later version.
 * 
 * cookie-miner is distributed in the hope that it will be useful, but 
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License 
 * along with cookie-miner. If not, see http://www.gnu.org/licenses/.
 *
 * @version: $Id$
 *
 */
#ifndef _COMMON_H_
#define _COMMON_H_

#include <string>

#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
        TypeName(const TypeName&); \
        void operator=(const TypeName&) 

class Uncopyable {
	public:
		Uncopyable() {}
		~Uncopyable() {}
	private:
		Uncopyable(const Uncopyable&);
		const Uncopyable& operator=(const Uncopyable&);
};

#ifdef _WIN32
#include <winsock.h>
#undef sleep
#define sleep(n) Sleep(n*1000)
#endif

bool trim_eol(std::string &s);

bool split_lr(  std::string& left, 
		std::string& right, 
		const char *sep, 
		const std::string& str);

#include <cstring>

size_t strlcpy(char *dst, const char *src, size_t n);

#endif
